<%-- 
    Document   : index
    Created on : 19/09/2012, 21:10:12
    Author     : Aluno
--%>
<%@page import="br.com.maternity.classes.entity.Usuario"%>
<%@page import="java.util.Date"%>
<%@page import="br.com.maternity.classes.entity.State"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="br.com.maternity.componentes.grid.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:include page="cabecalho.jsp"></jsp:include>
<%
    Usuario loggedUser = (Usuario) request.getSession(true).getAttribute("User");
    if (loggedUser != null) {
        switch (loggedUser.getTipo()) {
            case 1:
                response.sendRedirect(request.getContextPath() + "/relatorios/listagemPacientes.jsp");
                break;
            case 2:
                response.sendRedirect(request.getContextPath() + "/relatorios/listagemAvaliacao.jsp");
                break;
            case 3:
                response.sendRedirect(request.getContextPath() + "/relatorios/listagemTriagem.jsp");
                break;
            default:
                response.sendRedirect(request.getContextPath() + "/relatorios/listagemPacientes.jsp");
                break;
        }

    }
%>
<div id="painel">
    <span id="titulo">Login</span>
    <br/>
    <br/>
    <div id="erro"></div>
    <form name="frmLogin" id="frmLogin" action="POST">
        Tipo usuário: <br />
        <select id="tipoUsuario" name="tipoUsuario">
            <option value="0">Administrador</option>
            <option value="1">Atendente</option>
            <option value="2">Médico</option>
            <option value="3">Enfermeira</option>
        </select>
        <br />
        Login: <br /> <input type="text" name="txtLogin" id="txtLogin" />
        <br />
        Senha: <br /> <input type="password" name="txtSenha" id="txtSenha" />
        <br />
        <br />
        <a class="botao" href="#" onclick="enviaForm('frmLogin', 'login', 'erro');">Login</a>
    </form>
</div>
<jsp:include page="rodape.jsp"></jsp:include>
